<?php
declare (strict_types=1);

namespace app\api\controller;

use app\common\tool\Result;
use think\Response;
use app\common\model\Carousel as CarouselModel;

class Carousel extends Base
{
    public function index(): Response
    {
        $param = $this->request->param();
        $map = [];
        if (isset($param['type']) && $param['type']) {
            $map['type'] = $param['type'];
        }
        $list = CarouselModel::getList($map, true, 'sort', [], 'id,images,link,link_type,link_id');

        return Result::success('success', $list);
    }
}

